package cn.yeziji.forum.generate;

import cn.org.atool.generator.FileGenerator;
import cn.org.atool.generator.annotation.Table;
import cn.org.atool.generator.annotation.Tables;

/**
 * fluent mybatis 代码生成器
 *
 * @author gzkemays
 * @since 2021/12/7 9:12
 */
public class MybatisGenerateEntityCode {
  public static final String DATA_BASE = "yzj_forum";
  public static final String URL =
      "jdbc:mysql://127.0.0.1:4096/"
          + DATA_BASE
          + "?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai";
  public static final String USER_NAME = "root";
  public static final String PASSWORD = "gzkemays";
  public static final String SRC_DIR = "forum-dao\\src\\main\\java";
  public static final String BASE_PACK = "cn.yeziji.forum";
  public static final String DAO_DIR = "forum-dao\\src\\main\\java";

  public static void main(String[] args) {
    FileGenerator.build(Entity.class);
  }

  @Tables(
      url = URL,
      username = USER_NAME,
      password = PASSWORD,
      srcDir = SRC_DIR,
      basePack = BASE_PACK,
      daoDir = DAO_DIR,
      tables = {
        @Table(
            value = {
              /*              "forum_user_detail",
              "forum_user",
              "forum_details",
              "forum_comment",
              "forum_tags",
              "forum_user_comment",*/
              // "forum_chatroom"
              // "forum_file"
              // "forum_user_settings"
              // "forum_special_column"
              // "forum_feedback"
              // "forum_share_link"
              // "forum_friendly_link"
              // "forum_question",
              // "forum_answer",
              // "forum_question_answer",
              // "forum_user_qa"
              "merchant_wechat_pay_info"
            })
      })
  static class Entity {}
}
